package produce;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * 
 * 测试Callable
 * @author lcx
 *
 */

public class CallTest {
	

	public static void main(String[] args) throws InterruptedException, ExecutionException {
		CallThread td1=new CallThread();
		FutureTask task1=new FutureTask(td1);
		Thread thread1=new Thread(task1);
		thread1.start();
		System.out.println(task1.get());
	}
}

class CallThread implements Callable
{
	@Override
	public Object call() throws Exception {
		
		System.out.println("*****"+Thread.currentThread().getName());
		return "call";
	}
	
}